package com.bss.model;

// Generated Oct 27, 2011 10:37:49 PM by Hibernate Tools 3.3.0.GA

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.andy.basics.AbstractEntity;

/**
 * Bedtype generated by hbm2java
 */
@Entity
@Table(name = "payable")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Payable extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1839287856672445577L;

	private int id;

	private List<Payment> payments = new ArrayList<Payment>(0);

	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(final int id) {
		this.id = id;
	}

	public void setPayments(final List<Payment> payments) {
		this.payments = payments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "payable", cascade = CascadeType.PERSIST)
	public List<Payment> getPayments() {
		return this.payments;
	}

	@Override
	public String toString() {
		return "N/A";
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}
}
